from django.db import models

# Create your models here.


class Category(models.Model):
    name = models.CharField("分类",max_length=32,unique=True)

    def __str__(self):
        return self.name


class Link(models.Model):
    category = models.ForeignKey(Category,verbose_name="分类",on_delete=models.CASCADE,default=1)
    name = models.CharField("链接名称",max_length=32)
    slink = models.CharField("链接",max_length=100)


    def __str__(self):
        return self.name

# class Menu(models.Model):
#     category = models.ForeignKey(Category,on_delete=models.CASCADE)
#     link = models.ForeignKey(Link,on_delete=models.CASCADE)




